using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Jbe.TestSuite.Infrastructure.Interface;
using System.Windows.Forms;
using Jbe.TestSuite.TestDevice.Manager;
using Microsoft.Practices.CompositeUI.UIElements;
using Jbe.TestSuite.TestDevice.Manager.Constants;
using Microsoft.Practices.CompositeUI.Commands;

namespace Jbe.TestSuite.TestDevice.Manager.Tests.Views
{
    /// <summary>
    /// Summary description for TestDevicesViewFixture
    /// </summary>
    [TestClass]
    public class TestDevicesViewFixture : FixtureBase
    {
        private ControlledWorkItem<ModuleController> workItem;

        [TestInitialize]
        public override void TestInitialize()
        {
            base.TestInitialize();

            workItem = rootWorkItem.WorkItems.AddNew<ControlledWorkItem<ModuleController>>();
            workItem.Controller.Run();
        }

        [TestMethod]
        public void ViewRegistersUIExtensionSite()
        {
            // Check if the smart part added a UIExtensionSite
            Assert.IsTrue(workItem.UIExtensionSites.Contains(UIExtensionSiteNames.NewDevice));
        }

        [TestMethod]
        public void ViewRegistersCommands()
        {
            // Check if the smart part added four command adapters
            Assert.AreEqual(4, TestableToolStripItemCommandAdapter.Instances.Count, "Commands");
        }
    }
}
